package com.by.common.crud;

import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;

@SuppressWarnings("all")
public class BasicServiceImpl<T,M extends BasicMapper> implements BasicService<T>{

    @Autowired
    protected M basicMapper;

    @Override
    public int save(T entity) {
        return basicMapper.save(entity);
    }

    @Override
    public int update(T entity) {
        return basicMapper.update(entity);
    }

    @Override
    public int delete(Serializable id) {
        return basicMapper.delete(id);
    }

    @Override
    public T get(Serializable id) {
        return (T) basicMapper.get(id);
    }
}
